<%--
  Created by IntelliJ IDEA.
  User: 储依明
  Date: 2020/7/20
  Time: 23:05
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" errorPage="error.jsp" %>
<%@ include file="include.jsp" %>
<html>
<head>
    <title>主页</title>
</head>
<body>
<%--
    2.java代码块
    System.out.println("Hello JSP"); 普通输出语句，输出在控制台
    out.println("Hello JSP");
        out是JspWriter对象，输出在页面上
--%>

    <% int i = 1 / 0;   //制造一个错误, 使跳转到错误页面
    System.out.println(s);  //可以调用被包含jsp中的变量
%>

<%--
        3.jsp表达式
        <%="Hello"%>  相当于 out.println("Hello");
<%--

</body>
</html>
评论 ( 0 )